{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "d96c414d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world！\n"
     ]
    }
   ],
   "source": [
    "print(\"hello world！\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "e0a2df89",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n",
      "5\n",
      "6\n",
      "7\n",
      "8\n",
      "9\n",
      "done\n"
     ]
    }
   ],
   "source": [
    "for x in range(10):\n",
    "    print(x)\n",
    "    pass\n",
    "print('done')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "d39ab38c",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 这是一个简单两数相加求平均的函数\n",
    "def avg(x,y):\n",
    "    print(\"first input is\",x);\n",
    "    print(\"second input is\",y);\n",
    "    a=(x+y)/2.0;\n",
    "    print(\"average is\",a);\n",
    "    return a;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "26ad648a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "first input is 2.0\n",
      "second input is 3.0\n",
      "average is 2.5\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2.5"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "avg(2.0,3.0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "54d8764b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "910d67da",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0. 0.]\n",
      " [0. 0.]\n",
      " [0. 0.]]\n"
     ]
    }
   ],
   "source": [
    " a = numpy.zeros([3,2])\n",
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "59b0a140",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 1.  2.]\n",
      " [ 9.  0.]\n",
      " [ 0. 12.]]\n"
     ]
    }
   ],
   "source": [
    "a[0,0] = 1\n",
    "a[0,1] = 2\n",
    "a[1,0] = 9\n",
    "a[2,1] = 12\n",
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "407a37b9",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as pylot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "b1e60ddc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x1a1921a2410>"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAUAAAAGiCAYAAACWHB8jAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAayElEQVR4nO3df2yV9d3/8deRtqdsd3tUan8wSlsWqQjqsFVbYv3FN4U2ElCyYDS1LJtb74AEOjIpuvhj2bfZ4hwxKoQN8KvoRrKCYiBIc0tbF4pa7iIulo7NSjvWI5bhOcDmKdXP9w/DybqWQvFcp6Xv5yO5Eq/rfK5zPlcufe4651w98znnnADAoMtGegIAMFIIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALM8DeCJEydUUVGhQCCgQCCgiooKffbZZ0Pus3jxYvl8vn5LUVGRl9MEYFSCl09+//33629/+5t27dolSfrhD3+oiooKvfHGG0PuN3fuXG3atCm6npSU5OU0ARjlWQDb2tq0a9cu7du3T7fccosk6Te/+Y2Ki4vV3t6u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NAEYlePnkZWVlKisru+Dx69at0+TJk7VmzRpJ0rRp09TS0qKnn35aCxcuHHSfSCSiSCQSXQ+Hw19rzgDsGFWfATY3N6u0tLTftjlz5qilpUVnzpwZdJ/a2loFAoHokp2dHY+pAhgDRlUAg8GgMjIy+m3LyMhQX1+fenp6Bt2npqZGoVAounR1dcVjqgDGAE/fAl8Mn8/Xb905N+j2s/x+v/x+v+fzAjD2jKorwMzMTAWDwX7bjh07poSEBE2YMGGEZgVgrBpVASwuLlZ9fX2/bbt371ZhYaESExNHaFYAxipPA3jq1CkdOHBABw4ckPTVbS4HDhxQZ2enpK8+v3vwwQej46uqqnTkyBFVV1erra1NGzdu1IYNG7Ry5UovpwnAKE8/A2xpadGdd94ZXa+urpYkVVZW6sUXX1R3d3c0hpKUl5ennTt3asWKFXr++ec1ceJEPfvss+e8BQYAvg6fO/stwxgRDocVCAR03/88oKT/Shrp6cBjfy86OdJTQJz0uTNq0OsKhUJKTU2NyXOOqs8AASCeCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAswggALMIIACzCCAAszwNYFNTk+bNm6eJEyfK5/PptddeG3J8Q0ODfD7fgOXQoUNeThOAUQlePvnp06d1ww036Hvf+54WLlx4wfu1t7crNTU1un7VVVd5MT0AxnkawLKyMpWVlQ17v/T0dF1++eWxnxAA/BtPA3ixZs6cqc8//1zXXnutHnvsMd15553nHBuJRBSJRKLr4XBYkhScfUoJvkTP54qR9ebfD4z0FBAn4ZNf6oqpsX3OUfUlSFZWltavX6+6ujpt3bpV+fn5mj17tpqams65T21trQKBQHTJzs6O44wBXMp8zjkXlxfy+bRt2zYtWLBgWPvNmzdPPp9P27dvH/Txwa4As7OzdYfmcwVoAF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NDjnnvvfckDf4nd865c/4pniQtWrQo+s8zZsxQYWGhcnJytGPHDt17770XOWtv/efxnO8YBxs/2PbRbDjHPNyfUhtLxsK5Ho5YnetRG8ClS5fqvvvuG3JMbm6uDh48qE8++WTAY59++umA/1UcSlZWlnJyckblz26lpaVp3LhxA658jh07ds5jzMzMHHR8QkKCJkyY4NlcY+VijnkwRUVF2rx5c6ynN6pc6uc6Vi7mXI/aAKalpSktLe2844qLixUKhfTuu+/q5ptvliS98847CoVCmjVr1gW/3vHjx9XV1TUqf3YrKSlJBQUFqq+v1z333BPdXl9fr/nz5w+6T3Fxsd54441+23bv3q3CwkIlJiZ6Ot9YuJhjHoyFn1K71M91rFzUuf5aX6GMEnPnznXXX3+9a25uds3Nze66665zd999d78x+fn5buvWrc45506ePOl+/OMfu71797qOjg63Z88eV1xc7L71rW+5cDg8EodwXr///e9dYmKi27Bhg/vwww/d8uXL3Te/+U338ccfO+ecW7VqlauoqIiO/+ijj9w3vvENt2LFCvfhhx+6DRs2uMTERPeHP/xhpA5h2IZ7zL/+9a/dtm3b3J///Gf3pz/9ya1atcpJcnV1dSN1CBfl5MmTrrW11bW2tjpJ7plnnnGtra3uyJEjzrmxea6He8yxOtdjIoDHjx93DzzwgEtJSXEpKSnugQceGPD1uCS3adMm55xz//znP11paam76qqrXGJiops8ebKrrKx0nZ2d8Z/8MDz//PMuJyfHJSUluRtvvNE1NjZGH6usrHS33357v/ENDQ1u5syZLikpyeXm5rq1a9fGecZf33CO+Re/+IX79re/7ZKTk90VV1zhbr31Vrdjx44RmPXXc/YWj/9cKisrnXNj81wP95hjda75OSwAZl3yt8EAwMUigADMIoAAzCKAAMwigADMIoAAzCKAAMwigADMIoAAzCKAAMwigADM+v/Xz9vPtH+JYQAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pylot.imshow(a,interpolation=\"nearest\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "962caa7b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 定义一个python 对象\n",
    "class Dog:\n",
    "    def bark(self):\n",
    "        print(\"woof!\")\n",
    "        pass\n",
    "    pass"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "99696508",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "woof!\n"
     ]
    }
   ],
   "source": [
    "sizzles=Dog()\n",
    "sizzles.bark()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "a7e1ed3f",
   "metadata": {},
   "outputs": [],
   "source": [
    "class newDog:\n",
    "    # 初始化对象\n",
    "    def __init__(self,petname,temp):\n",
    "        self.name=petname;\n",
    "        self.temperature=temp;\n",
    "    # 返回对象状态\n",
    "    def status(self):\n",
    "        print(\"dog name is \",self.name);\n",
    "        print(\"dog temperature is\",self.temperature,\"度\");\n",
    "    def setTemperature(self,temp):\n",
    "        self.temperature=temp;\n",
    "        pass\n",
    "    def bark(self):\n",
    "        print(\"woof!\")\n",
    "        pass\n",
    "    pass"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "e68557f5",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dog name is  lessit\n",
      "dog temperature is 37 度\n"
     ]
    }
   ],
   "source": [
    "lessit = newDog(\"lessit\",37)\n",
    "lessit.status()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0df408b4",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
